package org.niugang;

import org.niugang.config.AccessFilter;
import org.springframework.boot.SpringApplication;
import org.springframework.cloud.client.SpringCloudApplication;
import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
import org.springframework.context.annotation.Bean;




/**
 * zuul启动类
 * 
 * @author niugang
 *
 */ 
@SpringCloudApplication
//可以直接用@SpringCloudApplication注解，该注解包含上面三个注解
/*
 *设置一个Zuul服务器端点并在其中安装一些反向代理过滤器，这样它就可以将请求转发给后端服务器
 */
@EnableZuulProxy
public class SpringCloudZuulApplication {

	public static void main(String[] args) {
		SpringApplication.run(SpringCloudZuulApplication.class, args);
	}
	
	//配置filter
	@Bean
	public AccessFilter accessFilter(){
		return  new AccessFilter();
	}
}
